import React, { useImperativeHandle, useRef } from 'react'

export default React.forwardRef(function Test(props, appRef) {
  const testRef = useRef()
  useImperativeHandle(appRef, () => {
    return {
      focus: function () {
        testRef.current.focus()
      },
    }
  })
  return (
    <div>
      <input type="text" ref={testRef} />
    </div>
  )
})
